package com.uwlaser.domain;

import com.uwlaser.base.CommonModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;
import java.sql.Timestamp;

/**
* @author zk-Qin
* @date 2022-05-11
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("craft_step_img")
public class CraftStepImg extends CommonModel<CraftStepImg> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "工步ID")
    private Integer stepId;

    @ApiModelProperty(value = "服务器路径")
    @NotBlank
    private String serverPath;

    @ApiModelProperty(value = "访问路径")
    @NotBlank
    private String visitPath;

    @ApiModelProperty(value = "原文件名")
    @NotBlank
    private String originalFileName;

    @ApiModelProperty(value = "文件名")
    @NotBlank
    private String fileName;

    @ApiModelProperty(value = "文件后缀")
    @NotBlank
    private String suffix;

    public void copyFrom(CraftStepImg source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
